package fangzhiyi.testbank;

/**
 * @author south wind
 * @version 1.0
 * @date 2025/3/20 20:11
 * @description
 */
public class Main {
    public static void main(String[] args) {
        // (1) 分别创建2个银行
        Bank bank1 = new Bank("中国银行");
        Bank bank2 = new Bank("工商银行");

        // (2) 在每个银行取得2张银行卡
        BankCard card1 = bank1.createCard("张三", "123456789012345678");
        BankCard card2 = bank1.createCard("李四", "987654321098765432");
        BankCard card3 = bank2.createCard("王五", "111122223333444455");
        BankCard card4 = bank2.createCard("赵六", "555566667777888899");

        // (3) 每个卡分别存2次钱
        bank1.deposit(card1, 1000);
        bank1.deposit(card1, 500);
        bank1.deposit(card2, 2000);
        bank1.deposit(card2, 300);
        bank2.deposit(card3, 1500);
        bank2.deposit(card3, 600);
        bank2.deposit(card4, 2500);
        bank2.deposit(card4, 700);

        // (4) 每个卡分别取1次钱
        bank1.withdraw(card1, 200);
        bank1.withdraw(card2, 500);
        bank2.withdraw(card3, 300);
        bank2.withdraw(card4, 1000);

        // (5) 显示每个卡的存款余额
        System.out.println("\n每个卡的存款余额:");
        System.out.println(card1);
        System.out.println(card2);
        System.out.println(card3);
        System.out.println(card4);

        // (6) 显示所有卡的累计余额
        System.out.println("\n所有卡的累计余额: " + BankCard.getTotalBalance());

        // (7) 显示每个银行的累计存款金额，累计取款金额
        System.out.println("\n每个银行的累计存款金额和累计取款金额:");
        System.out.println(bank1);
        System.out.println(bank2);

        // (8) 显示所有银行的累计存款金额，累计取款金额
        System.out.println("\n所有银行的累计存款金额: " + Bank.getAllTotalDeposit());
        System.out.println("所有银行的累计取款金额: " + Bank.getAllTotalWithdraw());
    }
}